/**
 * Licensed under the Apache License Version 2.0.
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package net.interknit.knitter.fw.init;

import javax.servlet.ServletConfig;

import net.interknit.knitter.fw.ServiceDelegate;

import org.apache.cxf.Bus;

public interface ServerInitializer
{
	/**
	 * Provides a mechanism to insert custom initialization logic when the server starts. If the server is
	 * created as a command line (stand-alone) server, the ServiceDelegate object is passed to the
	 * initialize() method. However, ServletConfig will not be available (will be null). Likewise, if the
	 * server is created from ServerServlet from a servlet container, the ServiceDelegate object will not be
	 * available (will be null). However, ServletConfig will be available and will be passed to initialize()
	 * method.
	 *
	 * @param bus
	 *            Live Apache CXF Bus object (always non-null)
	 * @param servletConfig
	 *            Live ServletConfig object (will be null if called from a stand-alone server)
	 * @param delegate
	 *            The ServiceDelegate object (will be null if called from a servlet container)
	 */
	public void initialize(Bus bus, ServletConfig servletConfig, ServiceDelegate delegate);
}
